package com.forum.module.blog.dal.mysql.category;

import com.forum.framework.common.pojo.PageResult;
import com.forum.framework.mybatis.core.mapper.BaseMapperX;
import com.forum.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.forum.module.blog.controller.category.vo.CategoryPageReqVO;
import com.forum.module.blog.dal.dataobject.category.CategoryDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface CategoryMapper extends BaseMapperX<CategoryDO> {
    default PageResult<CategoryDO> selectPage(CategoryPageReqVO pageReqVO) {
        return selectPage(pageReqVO, new LambdaQueryWrapperX<CategoryDO>()
                .eqIfPresent(CategoryDO::getName, pageReqVO.getName()));
    }
}
